package club.easin.product.dao;

import java.util.List;
import java.util.Map;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import club.easin.product.bean.Soft;
@Repository
public interface SoftRepository extends Neo4jRepository<Soft, Long>{
	
	/**根据产品名和产品阶段查找产品使用的软件*/
	@Query("match(n:Range{name:{name}})-[r:use_software{stage:{stage}}]->(m:soft) return m")
	public List<Soft> getSoftByName(@Param("name")String name,@Param("stage")String stage);
	
	/**根据软件名称获取软件描述和下载地址*/
	@Query("match(n:soft{name:{softName}}) return n.intro as intro ,n.download as download")
	public List<Map<String,Object>> getSoftDescAndDownload(@Param("softName")String softName);
	
	/**根据软件名称获取手册img和下载链接*/
	@Query("match(n:soft{name:{softName}}) return n.manual_img as imgurl,n.manual_down as download")
	public List<Map<String,Object>> getSoftmanual(@Param("softName")String softName);

}
